package com.tdx.blog_nowcoder.dao;


import com.tdx.blog_nowcoder.entity.Message;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface MessageMapper {

    List<Message> selectConversationsByUserId(int userId, int offset, int limit);
    int selectConversationCount(int userId);

    int findMessageCount(String conversationId);
    int findMessageUnReadCount(int userId,String conversationId);

    List<Message> findLettersByConversation(String conversationId,int offset,int limit);

    int findLetterCountByConversation(String conversationId);

    int updateMessageStatus(List<Integer> ids, int status);

    int addMessage(Message message);

    Message findLatestNotice(int userId, String topic);

    int findNoticesCount(int userId,String topic);

    int findNoticesUnreadCount(int userId,String topic);

    List<Message> findNoticesList(int userId, String topic, int offset, int limit);
}
